//
//  OwnerView.m
//  BasketballClub
//
//  Created by 孙鸿吉 on 16/1/13.
//  Copyright © 2016年 孙鸿吉. All rights reserved.
//

#import "OwnerView.h"

@implementation OwnerView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self allViews];
    }
    return self;
}
- (void)allViews
{
    self.backGroundImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 350 * LAYOUT_SIZE_HEIGHT)];
    [self addSubview:self.backGroundImageView];
    self.headViwe = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 154 * LAYOUT_SIZE , 154 * LAYOUT_SIZE_HEIGHT)];
    self.headViwe.backgroundColor = [UIColor colorWithWhite:256/255.0 alpha:0.3];
    self.headViwe.center = self.backGroundImageView.center;
    self.headViwe.layer.cornerRadius = 77 * LAYOUT_SIZE;
    self.headViwe.layer.masksToBounds = YES;

    [self.backGroundImageView addSubview:self.headViwe];
    self.headImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 140 * LAYOUT_SIZE, 140 * LAYOUT_SIZE_HEIGHT)];
    self.headImageView.center = self.backGroundImageView.center;
    self.headImageView.layer.cornerRadius = 70 * LAYOUT_SIZE;
    self.headImageView.layer.masksToBounds = YES;
    [self addSubview:self.headImageView];
    
    self.userNickName = [[UILabel alloc]initWithFrame:CGRectMake((SCREEN_WIDTH - 150*LAYOUT_SIZE)/2, 260 * LAYOUT_SIZE_HEIGHT, 150 * LAYOUT_SIZE, 30 * LAYOUT_SIZE_HEIGHT)];
    self.userNickName.text = @"篮球";
    self.userNickName.textAlignment = 1;
    self.userNickName.textColor = [UIColor yellowColor];
    self.userNickName.font = [UIFont systemFontOfSize:17 * LAYOUT_SIZE_HEIGHT];
    [self addSubview:self.userNickName];
    
    self.userStyle = [[UILabel alloc]initWithFrame:CGRectMake(0, 290 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH, 50 * LAYOUT_SIZE_HEIGHT)];
    self.userStyle.textAlignment = 1;
    self.userStyle.numberOfLines = 0;
    self.userStyle.font = [UIFont systemFontOfSize:17 * LAYOUT_SIZE];
    self.userStyle.text = @"无兄弟,不篮球";
    self.userStyle.textColor = [UIColor whiteColor];
    [self addSubview:self.userStyle];
    
    self.setImageButton = [[UIButton alloc]initWithFrame:CGRectMake(20 * LAYOUT_SIZE, 40 * LAYOUT_SIZE_HEIGHT, 30 * LAYOUT_SIZE, 30 * LAYOUT_SIZE_HEIGHT)];
    [self.setImageButton setImage:[UIImage imageNamed:@"iconfont-set"] forState:UIControlStateNormal];
    [self addSubview:self.setImageButton];
    
    self.backView = [[UIView alloc]initWithFrame:CGRectMake(40 * LAYOUT_SIZE, 65 * LAYOUT_SIZE_HEIGHT, 100 * LAYOUT_SIZE, 100 * LAYOUT_SIZE_HEIGHT)];
    self.backView.backgroundColor = [UIColor clearColor];
    [self addSubview:self.backView];
    
    self.pushImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
    self.pushImageView.image = [UIImage imageNamed:@"pushView"];
    self.pushImageView.layer.masksToBounds = YES;
    self.pushImageView.userInteractionEnabled = YES;
    self.pushImageView.layer.cornerRadius = 8;
    [self.backView addSubview:self.pushImageView];
    
    self.changeBackImage = [[UIButton alloc]initWithFrame:CGRectMake(10 * LAYOUT_SIZE, 2.5 * LAYOUT_SIZE_HEIGHT, 70 * LAYOUT_SIZE, 20 * LAYOUT_SIZE_HEIGHT)];
    [self.changeBackImage setTitle:@"背景图片" forState:UIControlStateNormal];
    self.changeBackImage.titleLabel.font = [UIFont systemFontOfSize:15 * LAYOUT_SIZE];
    self.changeBackImage.titleLabel.textAlignment = 1;
    [self.changeBackImage setTitleColor:ColorHex(0xFF6347) forState:UIControlStateNormal];
    self.changeBackImage.backgroundColor = [UIColor clearColor];
    self.changeBackImage.userInteractionEnabled = YES;
    [self.pushImageView addSubview:self.changeBackImage];
    
    self.setStyleImage = [[UIButton alloc]initWithFrame:CGRectMake(10 * LAYOUT_SIZE, 27.5 * LAYOUT_SIZE_HEIGHT * LAYOUT_SIZE_HEIGHT, 70 * LAYOUT_SIZE, 20 * LAYOUT_SIZE_HEIGHT)];
    [self.setStyleImage setTitleColor:ColorHex(0xFF6347) forState:UIControlStateNormal];
    [self.setStyleImage setTitle:@"个性头像" forState:UIControlStateNormal];
    self.setStyleImage.titleLabel.font = [UIFont systemFontOfSize:15 * LAYOUT_SIZE];
    self.setStyleImage.titleLabel.textAlignment = 1;
    self.setStyleImage.backgroundColor = [UIColor clearColor];
    self.setStyleImage.userInteractionEnabled = YES;
    [self.pushImageView addSubview:self.setStyleImage];
    
    self.lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 24 * LAYOUT_SIZE_HEIGHT, 90 * LAYOUT_SIZE, 2 * LAYOUT_SIZE_HEIGHT)];
    self.lineView.backgroundColor = ColorHex(0xFF6347);
    [self.pushImageView addSubview:self.lineView];
    
    //登陆按钮
    self.loginButton = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 50 * LAYOUT_SIZE, 40 * LAYOUT_SIZE_HEIGHT, 30 * LAYOUT_SIZE, 30 * LAYOUT_SIZE_HEIGHT)];
    [self.loginButton setImage:[UIImage imageNamed:@"iconfont-jiahao"] forState:UIControlStateNormal];
    [self addSubview:self.loginButton];
    
    //通用
    self.userLabel = [[UILabel alloc]initWithFrame:CGRectMake(30 * LAYOUT_SIZE, 370 * LAYOUT_SIZE_HEIGHT, 40 * LAYOUT_SIZE, 25 * LAYOUT_SIZE_HEIGHT)];
    self.userLabel.text = @"通用";
    self.userLabel.textColor = [UIColor lightGrayColor];
    self.userLabel.font = [UIFont systemFontOfSize:16 * LAYOUT_SIZE];
    self.userLabel.textAlignment = 1;
    [self addSubview:self.userLabel];
    //个人设置
    self.userView = [[UIView alloc]initWithFrame:CGRectMake(30 * LAYOUT_SIZE, 400 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH - 60 * LAYOUT_SIZE, 40 * LAYOUT_SIZE_HEIGHT)];
    self.userView.backgroundColor = [UIColor whiteColor];
    self.userView.layer.masksToBounds = YES;
    self.userView.layer.cornerRadius = 8;
    self.userView.layer.borderWidth = 1;
    self.userView.layer.borderColor = [UIColor lightGrayColor].CGColor;
    [self addSubview:self.userView];
    
    self.settingLabel = [[UILabel alloc]initWithFrame:CGRectMake(5 * LAYOUT_SIZE, 5 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH - 60 * LAYOUT_SIZE, 30 * LAYOUT_SIZE_HEIGHT)];
    self.settingLabel.text = @"个人设置";
    self.settingLabel.textColor = [UIColor grayColor];
    self.settingLabel.textAlignment = 0;
    self.settingLabel.font = [UIFont systemFontOfSize:17 * LAYOUT_SIZE];
    [self.userView addSubview:self.settingLabel];
    
    self.logoImageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(314 * LAYOUT_SIZE, 10 * LAYOUT_SIZE_HEIGHT, 20 * LAYOUT_SIZE, 20 * LAYOUT_SIZE_HEIGHT)];
    self.logoImageView1.image = [UIImage imageNamed:@"jiantou"];
    [self.userView addSubview:self.logoImageView1];
    //我的收藏
    self.collectView = [[UIView alloc]initWithFrame:CGRectMake(30 * LAYOUT_SIZE, 441 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH - 60 * LAYOUT_SIZE, 40 * LAYOUT_SIZE_HEIGHT)];
    self.collectView.backgroundColor = [UIColor whiteColor];
    self.collectView.layer.masksToBounds = YES;
    self.collectView.layer.cornerRadius = 8;
    self.collectView.layer.borderWidth = 1;
    self.collectView.layer.borderColor = [UIColor lightGrayColor].CGColor;
    [self addSubview:self.collectView];
    
    self.collectLabel = [[UILabel alloc]initWithFrame:CGRectMake(5 * LAYOUT_SIZE, 5 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH - 60 * LAYOUT_SIZE, 30 * LAYOUT_SIZE_HEIGHT)];
    self.collectLabel.text = @"我的收藏";
    self.collectLabel.textColor = [UIColor grayColor];
    self.collectLabel.textAlignment = 0;
    self.collectLabel.font = [UIFont systemFontOfSize:17 * LAYOUT_SIZE];
    [self.collectView addSubview:self.collectLabel];
    
    self.logoImageView2 = [[UIImageView alloc]initWithFrame:CGRectMake(314 * LAYOUT_SIZE, 10 * LAYOUT_SIZE_HEIGHT, 20 * LAYOUT_SIZE, 20 * LAYOUT_SIZE_HEIGHT)];
    self.logoImageView2.image = [UIImage imageNamed:@"jiantou"];
    [self.collectView addSubview:self.logoImageView2];
    
    //系统
    self.systemLabel = [[UILabel alloc]initWithFrame:CGRectMake(30 * LAYOUT_SIZE, 500 * LAYOUT_SIZE_HEIGHT, 40 * LAYOUT_SIZE, 25 * LAYOUT_SIZE_HEIGHT)];
    self.systemLabel.textAlignment = 1;
    self.systemLabel.textColor = [UIColor lightGrayColor];
    self.systemLabel.text = @"系统";
    self.systemLabel.font = [UIFont systemFontOfSize:16 * LAYOUT_SIZE];
    [self addSubview:self.systemLabel];

    //清理缓存
    self.clearView = [[UIView alloc]initWithFrame:CGRectMake(30 * LAYOUT_SIZE, 530 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH - 60 * LAYOUT_SIZE, 40 * LAYOUT_SIZE_HEIGHT)];
    self.clearView.backgroundColor = [UIColor whiteColor];
    self.clearView.layer.masksToBounds = YES;
    self.clearView.layer.cornerRadius = 8;
    self.clearView.layer.borderColor = [UIColor lightGrayColor].CGColor;
    self.clearView.layer.borderWidth = 1;
    [self addSubview:self.clearView];
    
    self.celarLabel = [[UILabel alloc]initWithFrame:CGRectMake(5 * LAYOUT_SIZE, 5 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH - 60 * LAYOUT_SIZE, 30 * LAYOUT_SIZE_HEIGHT)];
    self.celarLabel.text = @"清除缓存";
    self.celarLabel.textColor = [UIColor grayColor];
    self.celarLabel.textAlignment = 0;
    self.celarLabel.font = [UIFont systemFontOfSize:17 * LAYOUT_SIZE];
    [self.clearView addSubview:self.celarLabel];
    
    self.logoImageView3 = [[UIImageView alloc]initWithFrame:CGRectMake(314 * LAYOUT_SIZE, 10 * LAYOUT_SIZE_HEIGHT, 20 * LAYOUT_SIZE, 20 * LAYOUT_SIZE_HEIGHT)];
    self.logoImageView3.image = [UIImage imageNamed:@"jiantou"];
    [self.clearView addSubview:self.logoImageView3];
    //反馈
    self.systemView = [[UIView alloc]initWithFrame:CGRectMake(30 * LAYOUT_SIZE, 571 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH - 60 * LAYOUT_SIZE, 40 * LAYOUT_SIZE_HEIGHT)];
    self.systemView.backgroundColor = [UIColor whiteColor];
    self.systemView.layer.masksToBounds = YES;
    self.systemView.layer.cornerRadius = 8;
    self.systemView.layer.borderColor = [UIColor lightGrayColor].CGColor;
    self.systemView.layer.borderWidth = 1;
    [self addSubview:self.systemView];
    
    self.returnLabel = [[UILabel alloc]initWithFrame:CGRectMake(5 * LAYOUT_SIZE, 5 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH - 60 * LAYOUT_SIZE, 30 * LAYOUT_SIZE_HEIGHT)];
    self.returnLabel.text = @"反馈";
    self.returnLabel.textAlignment = 0;
    self.returnLabel.textColor = [UIColor grayColor];
    self.returnLabel.font = [UIFont systemFontOfSize:17 * LAYOUT_SIZE];
    [self.systemView addSubview:self.returnLabel];
    
    self.logoImageView4 = [[UIImageView alloc]initWithFrame:CGRectMake(314 * LAYOUT_SIZE, 10 * LAYOUT_SIZE_HEIGHT, 20 * LAYOUT_SIZE, 20 * LAYOUT_SIZE_HEIGHT)];
    self.logoImageView4.image = [UIImage imageNamed:@"jiantou"];
    [self.systemView addSubview:self.logoImageView4];
    //关于我们
    self.aboutMeView = [[UIView alloc]initWithFrame:CGRectMake(30 * LAYOUT_SIZE, 612 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH - 60 * LAYOUT_SIZE, 40 * LAYOUT_SIZE_HEIGHT)];
    self.aboutMeView.backgroundColor = [UIColor whiteColor];
    self.aboutMeView.layer.masksToBounds = YES;
    self.aboutMeView.layer.cornerRadius = 8;
    self.aboutMeView.layer.borderColor = [UIColor lightGrayColor].CGColor;
    self.aboutMeView.layer.borderWidth = 1;
    [self addSubview:self.aboutMeView];
    
    self.aboutMeLabel = [[UILabel alloc]initWithFrame:CGRectMake(5 * LAYOUT_SIZE, 5 * LAYOUT_SIZE_HEIGHT, SCREEN_WIDTH - 60 * LAYOUT_SIZE, 30 * LAYOUT_SIZE_HEIGHT)];
    self.aboutMeLabel.text = @"关于我们";
    self.aboutMeLabel.textAlignment = 0;
    self.aboutMeLabel.textColor = [UIColor grayColor];
    self.aboutMeLabel.font = [UIFont systemFontOfSize:17 * LAYOUT_SIZE];
    [self.aboutMeView addSubview:self.aboutMeLabel];
    
    self.logoImageView5 = [[UIImageView alloc]initWithFrame:CGRectMake(314 * LAYOUT_SIZE, 10 * LAYOUT_SIZE_HEIGHT, 20 * LAYOUT_SIZE, 20 * LAYOUT_SIZE_HEIGHT)];
    self.logoImageView5.image = [UIImage imageNamed:@"jiantou"];
    [self.aboutMeView addSubview:self.logoImageView5];


    
}
@end
